# -*- coding: UTF-8 -*-

from bottle import route,run,template
#使用模板文件tpl
#会自动在./views/或者是bottle。TEMPLATE_PATH设置的路径中寻找模板文件
#
@route('/hello')
@route('/hello/:name')
def hello(name = 'world'):
    return template('hello',name = name)

run(host="localhost",port=9898)


#第二种写法
@route('/hello/:name')
@view('hello')#模板文件名
def hello(name='ddd'):
    return dict(name = name0)

#自动重载：文件修改时自动更新

from bottle import run
run(reloader=True)